/*
*
**/

import 'dart:async';

import 'package:flutter/material.dart';

class Page2 extends StatefulWidget {

  Page2({Key? key}):super(key:key);

  @override
  State createState() => Page2State();
}

class Page2State extends State<Page2> with AutomaticKeepAliveClientMixin {

  @override
  void initState() {
    super.initState();
    print("Page 2 init");
  }

  bool _updating = false;

  updateData(){
    print('updateData-page2');
    setState(() {
      _updating = true;
    });
    Timer(Duration(seconds: 3),(){
      setState((){
        _updating = false;

      });
    });
  }

  @override
  Widget build(BuildContext context) {
    super.build(context);
    return  Column(
      children: [
        Text("Page 2"),
        _updating?CircularProgressIndicator(color:Colors.red):SizedBox.shrink(),
      ],
    );
  }

  @override
  bool get wantKeepAlive => true;

}